﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Data;
using ViewComponents.PowerPoint;
using ViewComponents.PowerPoint.ViewModels;

namespace ViewComponents.Converters
{
    public class ExcelSourceTypeToControlConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value == null) return null;

            switch ((ExcelSourceType)value)
            {
                case ExcelSourceType.Simple:
                    return new LiteralExcelSourceControl();

                case ExcelSourceType.LookUpSteps:
                    return new LookUpStepExcelSourceControl();

                default:
                    throw new InvalidOperationException("Source object type is not valid.");
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return DependencyProperty.UnsetValue;
        }
    }
}
